package com.lcifn.zk.console.support;

import org.apache.zookeeper.data.Stat;

import java.util.List;

/**
 * zk session interface
 */
public interface ZkSession {

    String SESSION_ID = "sessionId";

    /**
     * 获取session id
     * @return
     */
    String getSessionId();

    /**
     * 查询zk节点状态信息
     * @param path
     * @return
     */
    Stat statNode(String path) throws Exception;

    /**
     * 获取节点内容
     * @param path
     * @return
     */
    String getNodeData(String path) throws Exception;

    /**
     * 获取子节点路径
     * @param path
     * @return
     */
    List<String> childNode(String path) throws Exception;

    /**
     * 创建节点
     * @param path
     * @param data
     * @return
     */
    String createNode(String path, String data) throws Exception;


}
